home *** CD-ROM | disk | FTP | other *** search
/ Precision Software Appli…tions Silver Collection 4 / Precision Software Applications Silver Collection Volume 4 (1993).iso / stats / chadyn.exe / YCOMMM.C < prev    next >
Text File  |  1988-12-15  |  4KB  |  205 lines

  1.  
  2.  
  3.  
  4.  
  5. /*******************************  YCOMMM.C ***********************************/
  6. /*********************** MAIN MENU COMMANDS AND MENU *************************/
  7. /********************* (C) 1986,7,8 by JAMES A. YORKE ************************/
  8.  
  9.  
  10. #include "yinclud.h"
  11.  
  12. MainMenu() /* main part of parameter menu */
  13. {
  14.     FILE *output;
  15.  
  16.     output = StOutPut;
  17.     if (level == SETPARAM)
  18.         scr_clr();/* in desmets pcio.a */
  19.     scr_rowcol(1,0);
  20.     map_menu(output,MapName);/* in YMapMenu.c*/
  21.  
  22.     PRINT 
  23. "\n T:    begin plotting Trajectory; RT first Reboots previous crt picture\n");
  24.     PRINT 
  25. " XX:   terminate program\n");
  26.     PRINT 
  27. " MAPM: Process Menu of differential equations and maps\n");
  28.  
  29.  
  30.     PRINT 
  31. "\nSUBMENUS:    (hitting '+' and <enter> repeatedly cycles thru the menus)\n\n"
  32.             );
  33.  
  34.     PRINT 
  35. " PM:   set Parameters                  \n\n");
  36.     PRINT 
  37. " CM:   Color Menu              \n");
  38.     PRINT 
  39. " DM:   DISK input-output       \n");
  40.     PRINT 
  41. " DEM:  Differential Equations  \n");
  42.     PRINT 
  43. " IM:   Interrupts              \n");
  44.     PRINT 
  45. " VM:   Various and sundry      \n");
  46.     PRINT 
  47. " YM:   Vectors yn[]\n");
  48.     PRINT 
  49. " AM:   Advanced capabilities Menu \n\n\n");
  50. }
  51.  
  52. int advCapabilitiesMenu(CodeName)
  53. char    *CodeName;
  54. {
  55.     if (level == SETPARAM)
  56.         scr_clr();/* in desmets pcio.a */
  57.     scr_rowcol(1,0);
  58.  
  59.     PRINT 
  60. "             ADVANCED CAPABILITIES MENU \n\n");
  61.  
  62.     if (num_lyap != -9999)
  63.     {    PRINT 
  64. " L:    The number of LYAPUNOV EXPONENTS computed. Current number is %d;\n"
  65.                 ,num_lyap);
  66.         print_lyap(StOutPut);/* won't print unless lyaptime > 0 */
  67.         if (num_lyap > 0 && lyaptime > 0)
  68.             PRINT "\n");
  69.     }
  70.  
  71.     PRINT 
  72. "SUBMENUS:   \n");
  73.  
  74.     PRINT 
  75. " BM:   Basin of attraction \n");
  76.     PRINT 
  77. " BIFM: BIFurcation diagrams\n");
  78.     PRINT 
  79. " NM:   Newton method\n");
  80.     PRINT 
  81. " SM:   STRADDLE orbit\n");
  82.     PRINT 
  83. " UM:   Unstable manifold\n");
  84.     PRINT 
  85. "\n\n");
  86. }
  87.  
  88. int     MMCommands(CodeName)
  89. char    *CodeName;
  90. {
  91.     int oldTaskFlag;
  92.  
  93.     TEST("am")
  94.     {
  95.         advCapabilitiesMenu();/* in YCOMMM.C */
  96.         return(1);
  97.     }
  98.     TEST("bifm")
  99.     {
  100.         bifMenu();/* in YBIFRCAT.C */
  101.         return(1);
  102.     }
  103.     TEST("bm")
  104.     {
  105.         BasinMenu();
  106.         return(1);
  107.     }
  108.     TEST("cm")/* output */
  109.     {
  110.         ColorMenu();
  111.         return(1);
  112.     }
  113.     TEST("dem")
  114.     {
  115.         DEMenu();
  116.         return(1);
  117.     }
  118.     TEST("dm")
  119.     {
  120.         diskMenu();
  121.         return(1);
  122.     }
  123.     TEST("im")/* interrupts */
  124.     {
  125.         if (level == SETPARAM)
  126.             scr_clr();/* in desmets pcio.a */
  127.         scr_rowcol(0,0);
  128.  
  129.         PRINT 
  130. "         MENU OF KEYBOARD INTERRUPTS --FOR USE WHILE PLOTTING    \n");
  131.         getText("yintrpt.doc","keys");
  132.         return(1);
  133.     }
  134.     TEST("mapm")
  135.     {
  136.         if(level > 2)
  137.             PRINT 
  138. "Command MAPM cannot be called from this level; first return to menu;\n");
  139.         else
  140.             level = PICKMAP;
  141.               /* forces return to the part of program for
  142.                 selecting a new map */
  143.         return(1);
  144.     }
  145.     TEST("mm")
  146.     {
  147.         MainMenu();
  148.         return(1);
  149.     }
  150.     TEST("nm")
  151.     {
  152.         NewtonMenu();
  153.         return(1);
  154.     }
  155.     TEST("pm")
  156.     {
  157.         menuP();
  158.         return(1);
  159.     }
  160.     TEST("vm")/* various output */
  161.     {
  162.         menuV();
  163.         return(1);
  164.     }
  165.     TEST("rt")
  166.     {
  167.         oldTaskFlag = taskFlag;
  168.         boot = 1;
  169.         taskFlag = 0;/* this is just in case T is called from 
  170.             circle or some other routine that sets 
  171.             taskFlag >= 100  */
  172.         caseT();
  173.         taskFlag = oldTaskFlag;
  174.         return(1);
  175.     }
  176.     TEST("t")
  177.     {
  178.         oldTaskFlag = taskFlag;
  179.         taskFlag = 0;/* this is just in case caseT is called from 
  180.             circle or some other routine that sets 
  181.             taskFlag >= 100  */
  182.         caseT();
  183.         taskFlag = oldTaskFlag;
  184.         return(1);
  185.     }
  186.     TEST("um")
  187.     {
  188.         ManifoldMenu();
  189.         return(1);
  190.     }
  191.     TEST("xx")
  192.     {
  193. /*        level = KILL;*/
  194.         character_mode();/* in YSCREEN.C */
  195.         exit(0);
  196. /*        return(1);*/
  197.     }
  198.     TEST("ym")
  199.     {
  200.         menuY();
  201.         return(1);
  202.     }
  203.  
  204.     return(0);
  205. }